<template>
  <view class="four-contents">
    <view class="four-box" v-for="(item, index) in fourBoxes" :key="index">
      <view class="four-top-img">
        <image :src="item.img" />
      </view>
      <view class="four-top-content">
        <view class="title">{{ item.title }}</view>
        <view class="introduce">{{ item.introduce }}</view>
        <view class="price-number">
          <view class="number">{{ item.number }}人已学习</view>
          <view class="price">¥{{ item.price }}</view>
        </view>
      </view>
    </view>
  </view>
</template>
<script setup>
import { ref } from 'vue';

const props = defineProps({
  fourBoxes: {
    type: Array,
    required: true
  }
});
</script>

<style lang="scss" scoped>
.four-contents {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  width: 100%;

  .four-box {
    width: 325rpx;
    height: 460rpx;
    margin-bottom: 10px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 20rpx;
    overflow: hidden;

    .four-top-img {
      width: 100%;
      height: 240rpx;

      image {
        width: 100%;
        height: 100%;
      }
    }

    .four-top-content {
      width: 100%;
      height: 220rpx;
      background: #FFFFFF;
      display: flex;
      align-items: center;
      justify-content: space-around;
      flex-direction: column;

      .title {
        width: 284rpx;
        height: 80rpx;
        font-size: 28rpx;
        color: #424242;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .introduce {
        width: 284rpx;
        height: 34rpx;
        font-size: 24rpx;
        color: #999999;
      }

      .price-number {
        width: 284rpx;
        height: 34rpx;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .number {
          width: 162rpx;
          height: 100%;
          font-size: 24rpx;
          color: #999999;
        }

        .price {
          width: 86rpx;
          height: 100%;
          font-size: 24rpx;
          color: #F14545;
        }
      }
    }
  }
}
</style>